Add -Wdeclaration-after-statement to CFLAGS only if the
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 23 Nov 2005 10:15:18 +0000 (11:15 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 23 Nov 2005 10:15:18 +0000 (11:15 +0100)
compiler supports it. Move test-gcc-flag function to
Config.mk where it can be used by any component of the
build.

Signed-off-by: Keir Fraser <keir@xensource.com>
Config.mk
xen/Rules.mk

index b537fa5d4b6cea59985118e4bc16f61b5e9d19ff..4a85a103ed153c31cc32899f53e39e2c4387e895 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -8,7 +8,6 @@ XEN_TARGET_X86_PAE  ?= n
 # Tools to run on system hosting the build
 HOSTCC     = gcc
 HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
-HOSTCFLAGS += -Wdeclaration-after-statement
 
 AS         = $(CROSS_COMPILE)as
 LD         = $(CROSS_COMPILE)ld
@@ -39,7 +38,10 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
 endif
 
-CFLAGS += -Wdeclaration-after-statement 
+test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
+
+HOSTCFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement)
+CFLAGS     += $(call test-gcc-flag,-Wdeclaration-after-statement)
 
 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
index 0f43b4efa9a147b08d0c34ed43ad961a703d757d..f9721f03a2d1b4a206d2e800b517e9d527a110b1 100644 (file)
@@ -43,8 +43,6 @@ CFLAGS += -DACM_SECURITY
 endif
 ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
 
-test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
-
 include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
 
 ifneq ($(debug),y)